﻿<UserControl x:Class="Albatross.Shell.Views.SystemsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
			 xmlns:commonViews="clr-namespace:Albatross.WPF.Common.Views;assembly=Albatross.WPF.Common"
			 xmlns:behaviors="clr-namespace:Albatross.WPF.Common.Views;assembly=Albatross.WPF.Common"
			 xmlns:local="clr-namespace:Albatross.Shell.Views"
			 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="800" x:Name="View">


	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="Toolbar.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<Style TargetType="ListViewItem" x:Key="listitem">
				<Setter Property="Padding" Value="0"/>
				<Setter Property="VerticalContentAlignment" Value="Top"/>
			</Style>
			<DataTemplate x:Key="module_itemtemplate">
				<DockPanel Margin="2">
					<Image Source="{Binding Icon}" Width="32" Height="32" DockPanel.Dock="Top" VerticalAlignment="Top"/>
					<TextBlock Text="{Binding Name}" TextWrapping="Wrap" MaxWidth="50" TextAlignment="Center" VerticalAlignment="Top"/>
				</DockPanel>
			</DataTemplate>
		</ResourceDictionary>
	</UserControl.Resources>
	<DockPanel Background="Transparent">
		<ToolBar DockPanel.Dock="Top" Style="{StaticResource toolbar}">
			<Button Style="{StaticResource toolbar_btn}">
				<DockPanel>
					<Image Source="..\Images\Refresh.png" Style="{StaticResource toolbar_img}"/>
					<TextBlock Style="{StaticResource toolbar_text}">Refresh</TextBlock>
				</DockPanel>
			</Button>
			<Button Style="{StaticResource toolbar_btn}">
				<DockPanel>
					<Image Source="..\Images\Refresh.png" Style="{StaticResource toolbar_img}"/>
					<TextBlock Style="{StaticResource toolbar_text}">Enable</TextBlock>
				</DockPanel>
			</Button>
		</ToolBar>
		<Separator DockPanel.Dock="Top" Style="{StaticResource toolbar_bottom_seperator}" />
		<Grid>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="3*" />
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition  Width="2*"/>
			</Grid.ColumnDefinitions>
			<ListView x:Name="ListView" ItemsSource="{Binding Modules}" ItemTemplate="{StaticResource module_itemtemplate}" Background="Transparent" 
					  ItemContainerStyle="{StaticResource listitem}"
					  BorderThickness="1" BorderBrush="Silver" Margin="5 5 1 5" SelectionMode="Single" SelectedItem="{Binding SelectedModule}">
				<i:Interaction.Behaviors>
					<behaviors:SelectionChangedCommand Command="{Binding SelectedModuleChangedCommand}" />
				</i:Interaction.Behaviors>
				<ListView.ItemsPanel>
					<ItemsPanelTemplate>
						<WrapPanel Orientation="Horizontal"/>
					</ItemsPanelTemplate>
				</ListView.ItemsPanel>
			</ListView>
			<GridSplitter Grid.Column="1" Width="3" Margin="0 5 0 5" HorizontalAlignment="Center" VerticalAlignment="Stretch" />
			<Border Grid.Column="2" Margin="1 5 5 5" BorderThickness="1" BorderBrush="Silver">
				<ContentControl x:Name="DetailsRegion" commonViews:Attached.CompositeRegion="Details_Region" />
			</Border>
		</Grid>
	</DockPanel>
	<commonViews:Attached.ViewService>
		<commonViews:CompositeViewService DefaultRegion="Details_Region" />
	</commonViews:Attached.ViewService>
</UserControl>
